// Raf Lempens & Bjorn Schobben
#include "Pusher.h"
#include "ActivateAbility.h"

Pusher::Pusher(unsigned int initialCellX, unsigned int initialCellY): GameObject(initialCellX, initialCellY), activateAbility(0)
{
	// Setup abilities
	activateAbility = new ActivateAbility(this);
	blockMoveAbility = new BlockMoveAbility();


	AddAbility(activateAbility);
	AddAbility(blockMoveAbility);

	// Setup behaviour
	pushBehavior.SetActivator(this);
}

Pusher::~Pusher()
{
	if (activateAbility)
	{
		delete activateAbility;
		activateAbility = 0;
	}

	if (blockMoveAbility)
	{
		delete blockMoveAbility;
		blockMoveAbility = 0;
	}
}

void Pusher::SetDirection(const Direction& direction)
{
	wallDirection = direction;
	pushBehavior.SetPushDirection(direction.Opposed());
	blockMoveAbility->SetBlockDirection(direction);
}

void Pusher::Activate()
{
	printf("Pusher activated\n");
}

GameBehavior* Pusher::GetBehavior()
{
	return &pushBehavior;
	//return 0;
}
